VERSION 5.00
Begin VB.Form frmNick 
   BorderStyle     =   1  'Fixed Single
   ClientHeight    =   1470
   ClientLeft      =   15
   ClientTop       =   15
   ClientWidth     =   4680
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1470
   ScaleWidth      =   4680
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdOK 
      Caption         =   "OK"
      Default         =   -1  'True
      Height          =   375
      Left            =   3480
      TabIndex        =   2
      Top             =   1080
      Width           =   1095
   End
   Begin VB.CommandButton cmdExit 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      Height          =   375
      Left            =   2280
      TabIndex        =   3
      Top             =   1080
      Width           =   1095
   End
   Begin VB.TextBox txtNick 
      Height          =   285
      Left            =   480
      TabIndex        =   1
      Top             =   600
      Width           =   3255
   End
   Begin VB.Label Label1 
      Height          =   255
      Left            =   360
      TabIndex        =   0
      Top             =   360
      Width           =   4575
      WordWrap        =   -1  'True
   End
End
Attribute VB_Name = "frmNick"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

' 0 - startup
' 1 - forced nick change
' 2 - nick change
Public FormMode As Integer

Private Sub cmdExit_Click()
If Settings.Nickname = "" Then
MsgBox lang.Messages(89), vbInformation, lang.Messages(88)
End If

frmMain.MNUServList.Enabled = False

Select Case FormMode
  Case 0, 1
    Unload frmMain
    Unload Me
    End
  Case 2, 3
    Unload Me
End Select

End Sub

Private Sub cmdOk_Click()
txtNick.Text = Replace(txtNick.Text, " ", "")
txtNick.Text = TrimNonAlpha(txtNick.Text)
If txtNick.Text = "" Then
      MsgBox lang.Messages(40), vbOKOnly + vbCritical, lang.Messages(20)
  Exit Sub
End If

If frmMain.MNUServList.Enabled = False Then
frmMain.MNUServList.Enabled = True
End If

Select Case FormMode
Case 0
  frmMain.SpeechInterface.StopSpeech
  Settings.Nickname = txtNick.Text
  frmMain.Show
  Unload Me
Case 1
  frmMain.SpeechInterface.StopSpeech
  Settings.Nickname = txtNick.Text
  Unload Me
Case 2
  frmMain.SpeechInterface.StopSpeech
  frmMain.IRCInterface.RawSend "NICK " + txtNick.Text
  Settings.Nickname = txtNick.Text
  Unload Me
Case 3
  frmMain.SpeechInterface.StopSpeech
  frmMain.IRCInterface.RawSend "NICK " + txtNick.Text
  Settings.Nickname = txtNick.Text
  Unload Me
End Select

End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF2 And Shift = 0 Then
frmMain.SpeechInterface.Say lang.Help(5)
End If
End Sub

Private Sub Form_Load()
Me.Caption = lang.Messages(38)
Label1.Caption = lang.Messages(39)
cmdOk.Caption = lang.Buttons(2)
cmdExit.Caption = lang.Buttons(3)

If Settings.Nickname <> "" Then
  txtNick.Text = Settings.Nickname
  txtNick.SelStart = 0
  txtNick.SelLength = Len(txtNick.Text)
End If


End Sub




